<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('app账号信息')" />
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="role-form">
					<div class="select-list">
						<ul>
							<li>
								手机号：<input type="text" name="phone"/>
							</li>
<!--							<li>-->
<!--							<input type="text" name="isExPire"/>-->
<!--							</li>-->
							<li>
								是否超过两小时:
								<select name="done" id="done" placeholder="是否超过两小时" class="form-control" style="display: inline-block">
									<option value="">全部</option>
									<option value="true">是</option>
									<option value="false">否</option>
								</select>
							</li>
							<li   id="element" shiro:hasPermission="system:app:removeAll" >
<!--									<span >查看用户:</span>-->
									<select id="userName" name="userId" class="type form-control" style="display: inline-block">
										<!--<option  th:field="*{userId}">{{userName}} </option>-->
									</select>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
								<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;导出</a>
							</li>

						</ul>
					</div>
				</form>
			</div>


			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:app:add">
					<i class="fa fa-plus"></i> 新增
				</a>

					<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:app:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
			</div>

			<div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: jquery-cxselect-js" />
	<script th:inline="javascript">
		var editFlag = [[${@permission.hasPermi('system:app:edit')}]];
		var removeFlag = [[${@permission.hasPermi('system:app:remove')}]];
		var prefix = ctx + "system/app";
		$(function () {
			listUser();
		})
		function listUser() {
			var url = '/system/user/listUser';

			$.operate.get(url,function (result) {

				if (result.code==0){
					var data =result.data;
					$('#element').cxSelect({
						selects: ['type', 'router'],
						jsonValue: 'v',
						data: data
					});
				}

			});
		};
		$(function() {
		    var options = {
		        url: prefix + "/list",
		        createUrl: prefix + "/add",
		        updateUrl: prefix + "/edit/{id}",
		        removeUrl: prefix + "/remove",
				detailUrl: prefix + "/detail/{id}",
				exportUrl: prefix + "/export",
		        modalName: "app账号",
				showExport: true,
		        columns: [{
		            checkbox: true
		        },
		        {
		            field: 'id',
		            title: '编号'
		        },
		        {
		            field: 'phone',
		            title: '手机号'
		        },
		        {
		            field: 'expectedTime',
		            title: '预计时间'
		        },
		        {
		            field: 'isExPire',
		            title: '是否超过两小时'
		        },
				// {
				// 	field: 'cookie',
				// 	title: '登录信息',
				// 	sortable: true
				// },
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		                var actions = [];
		                actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')">查看</a> ');

						return actions.join('');
		            }
		        }]
		    };
		    $.table.init(options);
		});
		
		/* 角色管理-分配用户 */
		function authUser(roleId) {
		    var url = prefix + '/authUser/' + roleId;
		    $.modal.openTab("分配用户", url);
		}

	</script>
</body>
</html>